<?php
include "conexion.php";


function insertar_datos(){

$nombre[0]="Tomas";
$nombre[1]="Luis";
$nombre[2]="Pedro";
$nombre[3]="Juan";
$nombre[4]="Pepe";
$nombre[5]="Fernando";
$nombre[6]="Alberto";
$nombre[7]="Manuel";
$nombre[8]="Miguel";
$nombre[9]="Marta";
$nombre[10]="Maria";
$nombre[11]="Estefania";
$nombre[12]="Cristina";
$nombre[13]="Monica";
$nombre[14]="Jose Luis";
$nombre[15]="Mariano";
$nombre[16]="Alfredo";
$nombre[17]="Alexander";

$ap[0]="Perez";
$ap[1]="Garcia";
$ap[2]="Gomez";
$ap[3]="De la Calle";
$ap[4]="Sanchez";
$ap[5]="Bravo";
$ap[6]="Jimenez";
$ap[7]="Sanchez";
$ap[8]="Fernandez";
$ap[9]="Fraga";
$ap[10]="Rodriguez";
$ap[11]="Zapatero";
$ap[12]="Rajoy";
$ap[13]="Rubalcaba";
$ap[14]="Fleming";
$ap[15]="Tu Madre en Bragas";

if (file_exists("../extData/Aleatorios.sql")) {
$sv = conectar();
	$fich = fopen("../extData/Aleatorios.sql","w");
	for ($i=1;$i < 7; $i++) {
		$linea = 'INSERT INTO PROFESOR VALUES ("pr_'.$ap[$i].$ap[$i+4][0].$ap[$i+4][1].'","pass","'.$nombre[$i].'","'.$ap[$i].' '.$ap[$i+4].'","91566778'.$i.'","0000","pr_'.$ap[$i].$ap[$i+4][0].$ap[$i+4][1].'@montserrat.es","0543030'.$i.'","","");';
		fputs ($fich,$linea."\n");
		$linea = 'INSERT INTO PADRE VALUES ("15430'.$i.'","'.$nombre[15-$i].'","'.$ap[15 -$i].' '.$ap[15-($i+4)].'","pdr_'.$ap[15-$i].$ap[15-($i+4)][0].$ap[15-($i+4)][1].'@padres.es","91356778'.$i.'","pdr_'.$ap[15-$i].$ap[15-($i+4)][0].$ap[15-($i+4)][1].'","pass");';
		fputs ($fich,$linea."\n");
		$linea = 'INSERT INTO ALUMNO VALUES ("00000'.$i.'","1043230'.$i.'","'.$nombre[10-$i].'","'.$ap[15 -$i].' '.$ap[15-($i+4)].'","al_'.$ap[15-$i].$ap[15-($i+4)][0].$ap[15-($i+4)][1].'@alumnos.es","15430'.$i.'","al_'.$ap[15-$i].$ap[15-($i+4)][0].$ap[15-($i+4)][1].'","pass");';
		fputs ($fich,$linea."\n");
		}
}
}
function insertar_horario (){

$sv=conectar();
	$linea = 'INSERT INTO HORARIO VALUES ("000001","Lunes","08:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000002","Lunes","08:55:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000003","Lunes","10:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000004","Lunes","11:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000005","Lunes","12:10:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000006","Lunes","13:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000007","Lunes","14:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000008","Lunes","15:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000009","Lunes","16:00:00");';
	mysql_query($linea);
	
	
	
	$linea = 'INSERT INTO HORARIO VALUES ("000011","Martes","08:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000012","Martes","08:55:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000013","Martes","10:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000014","Martes","11:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000015","Martes","12:10:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000016","Martes","13:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000017","Martes","14:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000018","Martes","15:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000019","Martes","16:00:00");';
	mysql_query($linea);
	
	
	
	$linea = 'INSERT INTO HORARIO VALUES ("000021","Miercoles","08:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000022","Miercoles","08:55:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000023","Miercoles","10:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000024","Miercoles","11:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000025","Miercoles","12:10:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000026","Miercoles","13:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000027","Miercoles","14:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000028","Miercoles","15:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000029","Miercoles","16:00:00");';
	mysql_query($linea);
	
	
	$linea = 'INSERT INTO HORARIO VALUES ("000031","Jueves","08:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000032","Jueves","08:55:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000033","Jueves","10:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000034","Jueves","11:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000035","Jueves","12:10:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000036","Jueves","13:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000037","Jueves","14:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000038","Jueves","15:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000039","Jueves","16:00:00");';
	mysql_query($linea);
	
	
	$linea = 'INSERT INTO HORARIO VALUES ("000041","Viernes","08:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000042","Viernes","08:55:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000043","Viernes","10:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000044","Viernes","11:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000045","Viernes","12:10:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000046","Viernes","13:05:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000047","Viernes","14:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000048","Viernes","15:00:00");';
	mysql_query($linea);
	$linea = 'INSERT INTO HORARIO VALUES ("000049","Viernes","16:00:00");';
	mysql_query($linea);
//	fputs ($fich,$linea."\n");
		
}
?>